package com.zmn.oms.api.handler;

import com.github.ltsopensource.core.commons.utils.CollectionUtils;
import com.github.ltsopensource.core.domain.JobResult;
import com.github.ltsopensource.jobclient.support.JobCompletedHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;

/**
 * 接收Task任务执行反馈
 * @author nowind
 * @date 2017/10/18 17:13
 */
public class JobCompleteHandle implements JobCompletedHandler {
    private Logger logger = LoggerFactory.getLogger(JobCompleteHandle.class);

    @Override
    public void onComplete(List<JobResult> list) {

        // 任务执行反馈结果处理
        if (CollectionUtils.isNotEmpty(list)) {
            for (JobResult job : list) {
                logger.error(String.format("[zmn]任务执行完成,taskId:[%s],", job.getJob().getTaskId()));
            }
        }
    }
}
